<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>AdWords::Error::ApiError</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
    <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
</head>

<body>     
    <div class="banner">
        <h1>
            <span class="type">Class</span> 
            AdWords::Error::ApiError 
            
                <span class="parent">&lt; 
                    
                    <a href="../Error.html">AdWords::Error</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../files/lib/adwords4r_rb.html">lib/adwords4r.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
    
    <div class="description">
        <p>
Raised if a call returns with a SOAP error, gives you easy access to
adwords error fields
</p>

    </div>
    

    

    
    

    
    
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
    
        <dt>N</dt>
        <dd>
            <ul>
                
                <li><a href="#method-c-new">new</a></li>
                
            </ul>
        </dd>
    
    </dl>
    

    

    

    

    

    
    <div class="sectiontitle">Attributes</div>
    <table border='0' cellpadding='5'>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>soap_faultcode</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>soap_faultstring</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>top_code</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>internal</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>message</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>code</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>detail</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>field</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>index</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>isExemptable</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>textIndex</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>textLength</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>trigger</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>trigger_ex</td>
            <td class='attr-desc'><p>
The *_ex attributes have been added to correct deficiencies with the
initial implementation. They should expose more useful information (i.e.
text of errors instead of a SOAP element) and proper mapping of a
fault&#8217;s trigger and code. The old attributes are left behind for
backward compatibility; hopefully this isn&#8217;t too confusing!
</p></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>soap_faultcode_ex</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>soap_faultstring_ex</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>code_ex</td>
            <td class='attr-desc'></td>
        </tr>
        
        <tr valign='top'>
            <td class='attr-rw'>
                [RW]
            </td>
            <td class='attr-name'>inner_fault</td>
            <td class='attr-desc'></td>
        </tr>
        
    </table>
    

    
            <div class="sectiontitle">Class Public methods</div>
            
            <div class="method">
                <div class="title" id="method-c-new">
                    
                    <a name="method-c-new"></a><b>new</b>(soap_fault)
                    
                </div>
                
                <div class="description">
                  <p>
Constructor for <a href="ApiError.html">ApiError</a>.
</p>
<p>
Args:
</p>
<ul>
<li><p>
soap_fault: SOAP fault returned by the service.
</p>
</li>
</ul>

                </div>
                
                
                
                
                <div class="sourcecode">
                    <p class="source-link">
                        Source: <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
                        
                    </p>
                    <div id="method-c-new_source" class="dyn-source">
                        <pre>     <span class="ruby-comment cmt"># File lib/adwords4r.rb, line 371</span>
371:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">soap_fault</span>)
372:         <span class="ruby-ivar">@soap_faultcode</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">soap_fault</span>.<span class="ruby-identifier">faultcode</span> }
373:         <span class="ruby-ivar">@soap_faultcode_ex</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">soap_fault</span>.<span class="ruby-identifier">faultcode</span>.<span class="ruby-identifier">text</span> }
374:         <span class="ruby-ivar">@soap_faultstring</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">soap_fault</span>.<span class="ruby-identifier">faultstring</span> }
375:         <span class="ruby-ivar">@soap_faultstring_ex</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">soap_fault</span>.<span class="ruby-identifier">faultstring</span>.<span class="ruby-identifier">text</span> }
376:         <span class="ruby-ivar">@inner_fault</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">soap_fault</span> }
377:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">soap_fault</span>.<span class="ruby-identifier">detail</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">soap_fault</span>.<span class="ruby-identifier">detail</span>.<span class="ruby-identifier">fault</span> }
378:           <span class="ruby-identifier">fault</span> = <span class="ruby-identifier">soap_fault</span>.<span class="ruby-identifier">detail</span>.<span class="ruby-identifier">fault</span>
379:           <span class="ruby-ivar">@top_code</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">fault</span>.<span class="ruby-identifier">code</span> }
380:           <span class="ruby-ivar">@internal</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">fault</span>.<span class="ruby-identifier">internal</span> }
381:           <span class="ruby-ivar">@message</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">fault</span>.<span class="ruby-identifier">message</span> }
382:           <span class="ruby-ivar">@trigger_ex</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">fault</span>.<span class="ruby-identifier">trigger</span> }
383:           <span class="ruby-ivar">@code_ex</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">fault</span>.<span class="ruby-identifier">code</span> }
384:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">fault</span>.<span class="ruby-identifier">errors</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">fault</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> }
385:             <span class="ruby-identifier">error</span> = <span class="ruby-identifier">fault</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">first</span>
386:             <span class="ruby-ivar">@code</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">error</span>.<span class="ruby-identifier">code</span> }
387:             <span class="ruby-ivar">@detail</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">error</span>.<span class="ruby-identifier">detail</span> }
388:             <span class="ruby-ivar">@field</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">error</span>.<span class="ruby-identifier">field</span> }
389:             <span class="ruby-ivar">@index</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">error</span>.<span class="ruby-identifier">index</span> }
390:             <span class="ruby-ivar">@isExemptable</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">error</span>.<span class="ruby-identifier">isExemptable</span> }
391:             <span class="ruby-ivar">@textIndex</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">error</span>.<span class="ruby-identifier">textIndex</span> }
392:             <span class="ruby-ivar">@textLength</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">error</span>.<span class="ruby-identifier">textLength</span> }
393:             <span class="ruby-ivar">@trigger</span> = <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">error</span>.<span class="ruby-identifier">trigger</span> }
394:           <span class="ruby-keyword kw">end</span>
395:         <span class="ruby-keyword kw">end</span>
396:       <span class="ruby-keyword kw">end</span></pre>
                    </div>
                </div>
                
            </div>
            
</div>
    </div>
  </body>
</html>    